package com.cordershy.controller;

import com.cordershy.service.mailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class mailController {
    @Autowired
    mailService mailService;
    @RequestMapping("/sendMail")
    public String sendMail(@RequestParam("mailAddress") String mailAddress ) {
        mailService.sendMail(mailAddress);
        return "success send mail";
    }
    @RequestMapping("/confirmCode")
    public String confirmCode(@RequestParam("code") String code,@RequestParam("username") String username,@RequestParam("userpassword")String userpassword){
        System.out.println(username);
        return mailService.confirmCode(code,username,userpassword);
    }
}
